import request from '@/config/axios'

// 获取客户详情
export const getByKey = async (params) => {
  return await request.get({ url: `/service/customer/get-by-session-id`, params })
}
// 更新客户资料
export const updateCustomer = async (data) => {
  return await request.put({ url: `/service/customer/update-by-session-id`, data })
}
// 获取聊天记录
export const getChatMessage = async (params) => {
  return await request.get({ url: `/service/message/get-chat-message`, params })
}
// 获取客户列表分页
export const getCustomerPage = async (params) => {
  return await request.get({ url: `/service/customer/page`, params })
}

// 常用语
export const getCommonphrase = async (params) => {
  return await request.get({ url: `/service/common-phrase/simple-list`, params })
}
// 常用语创建
export const createCommonphrase = async (data) => {
  return await request.post({ url: `/service/common-phrase/create`, data })
}
// 常用语更新
export const updateCommonphrase = async (data) => {
  return await request.put({ url: `/service/common-phrase/update`, data })
}
// 常用语删除
export const deleteCommonphrase = async (id) => {
  return await request.delete({ url: `/service/common-phrase/delete?id=` + id })
}
